from distutils.core import setup

from distutils.extension import Extension
from Cython.Distutils import build_ext

import platform, shutil
if platform.architecture()[0] == "32bit":
    setup(
            cmdclass = {'build_ext': build_ext}, 
            ext_modules = [Extension("test_serial",  ["test_serial.pyx"])])
    shutil.copyfile("test_serial.so", "../32bit/test_serial.so")
elif platform.architecture()[0] == "64bit":
    setup(
            cmdclass = {'build_ext': build_ext}, 
            ext_modules = [Extension("test_serial_64",  ["test_serial.pyx"])])
    shutil.copyfile("test_serial_64.so", "../64bit/test_serial.so")
else:
    raise Exception("Unknown platform %s: should be 32bit or 64bit" % platform.architecture()[0])
    

